/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 compound_object_model.h

	$Header: /heroes4/compound_object_model.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( COMPOUND_OBJECT_MODEL_H_INCLUDED )
#define COMPOUND_OBJECT_MODEL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_object_model.h"
#include "object_segment_ptr.h"

// --------------------------------------------------------------------------
// t_combat_object_model class
// --------------------------------------------------------------------------
class t_object_segment : public t_counted_object, public t_image_sequence,
                         public t_combat_object_model_root
{
public:
	// Constructors
	t_object_segment( t_combat_object_model_root const& object_data,
					  int							    footprint_size,
					  t_map_point_2d			 const& offset,
		              t_image_sequence_base_base const& frame_order,
		              t_bitmap_group             const& bitmaps );
	int								get_footprint_size() const;
	t_map_point_2d const&			get_segment_offset() const;
protected:
	int			   m_footprint_size;
	t_map_point_2d m_segment_offset;
};

typedef std::vector<t_object_segment_ptr>   t_object_segment_array;

inline int t_object_segment::get_footprint_size() const
{
	return m_footprint_size;
}

inline t_map_point_2d const& t_object_segment::get_segment_offset() const
{
	return m_segment_offset;
}

// --------------------------------------------------------------------------
// t_combat_object_model_base class
// --------------------------------------------------------------------------
class t_compound_object_model 
{
public:
	// Constructor/Destructor
	t_compound_object_model( t_combat_object_model_24 const& source, double scale );
	~t_compound_object_model();

	// Member functions
	t_map_point_2d         const& get_footprint_size() const;
	int							  get_frame_count() const;
	t_object_segment_array const& get_segments() const;
	t_obstacle_type				  get_type() const;
private:
	t_map_point_2d         m_footprint_size;
	t_object_segment_array m_segments;
	t_obstacle_type		   m_type;
};

inline t_map_point_2d const& t_compound_object_model::get_footprint_size() const
{
	return m_footprint_size;
}

inline int t_compound_object_model::get_frame_count() const
{
	return m_segments[0]->get_frame_count();
}

inline t_object_segment_array const& t_compound_object_model::get_segments() const
{
	return m_segments;
}

inline t_obstacle_type t_compound_object_model::get_type() const
{
	return m_type;
}

#endif // COMPOUND_OBJECT_MODEL_H_INCLUDED